fix(auth): update code/token generation from CLI and redirect to successful page#518
fix(auth): update code/token generation from CLI and redirect to successful page#518eduardoRoth wants to merge 7 commits intomainfrom
Conversation
…to `cli-log-in` page
c4afd3c to
db76111
Compare
jeremymwells
left a comment
There was a problem hiding this comment.
LGTM.
Is there no way to test this?
|
@jeremymwells , you can pull this branch and the branch of #350 from
You need to add to your |
|
@eduardoRoth - fair point. I meant automated tests. Also, macos, ubuntu, and windows node version tests should pass, right? |
|
@jeremymwells whoops, sorry, i thought you wanted to test it. |
| export const GRAPHQL_HOST = 'https://gateway.prod.apps.herodevs.io'; | ||
| export const GRAPHQL_PATH = '/graphql'; | ||
| export const ANALYTICS_URL = 'https://apps.herodevs.com/api/eol/track'; | ||
| export const EOL_REPORT_URL = process.env.EOL_REPORT_URL || 'https://apps.herodevs.com/eol/reports'; |
There was a problem hiding this comment.
suggestion: as we already have these values in the config object below, I think we can either remove this block or the config, so we have a single source of truth, as these constants are being exported and may confuse consumers.
| import AuthLogin from '../../../src/commands/auth/login.ts'; | ||
| import { refreshIdentityFromStoredToken } from '../../../src/service/analytics.svc.ts'; | ||
| import { persistTokenResponse } from '../../../src/service/auth.svc.ts'; | ||
| import type { TokenResponse } from '../../../src/types/auth.js'; |
There was a problem hiding this comment.
issue: possible typo on auth.js.
Changes required by https://github.com/neverendingsupport/eol-report-card/pull/350 to allow users to keep their authenticated session on the web app after a successful authentication from the CLI.
This PR changes the flow for the code and token generation. Before the local server was stopped after the
codefrom keycloak was received, sending atext/painresponse, and generating the tokens after that.The new flow generates the code, then the tokens and, after getting them, it redirects to a page on the
eol-report-cardweb app that handles the creation of the session cookie.